import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _inherits from "@babel/runtime/helpers/esm/inherits";
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
import _isUndefined from "lodash/isUndefined";
var _excluded = ["label", "itemLabel", "content", "btns", "className"];

/**
 * LineItem.js
 * @date 2018/11/26
 */
import React from 'react';
import styles from "../index.less?modules";

var LineItem = /*#__PURE__*/function (_React$Component) {
  _inherits(LineItem, _React$Component);

  var _super = _createSuper(LineItem);

  function LineItem() {
    _classCallCheck(this, LineItem);

    return _super.apply(this, arguments);
  }

  _createClass(LineItem, [{
    key: "render",
    value: function render() {
      var _this$props = this.props,
          label = _this$props.label,
          itemLabel = _this$props.itemLabel,
          content = _this$props.content,
          btns = _this$props.btns,
          className = _this$props.className,
          other = _objectWithoutProperties(_this$props, _excluded);

      var itemClassName = styles['line-item'];

      if (className) {
        itemClassName += " ".concat(className);
      }

      var labelElement = null;

      if (_isUndefined(itemLabel)) {
        labelElement = /*#__PURE__*/React.createElement("div", {
          className: styles['line-item-label']
        }, label);
      } else {
        labelElement = itemLabel;
      }

      return /*#__PURE__*/React.createElement("div", Object.assign({
        className: itemClassName
      }, other), labelElement, /*#__PURE__*/React.createElement("div", {
        className: styles['line-item-content']
      }, content), /*#__PURE__*/React.createElement("div", {
        className: styles['line-item-btns']
      }, btns));
    }
  }]);

  return LineItem;
}(React.Component);

export { LineItem as default };